package com.teemor.blog.service.impl;

import com.teemor.blog.entity.TbArticle;
import com.teemor.blog.entity.condition.TbArticleCondition;
import com.teemor.blog.mapper.TbArticleMapper;
import com.teemor.blog.service.IArticleService;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ArticleServiceImpl implements IArticleService {
    @Autowired
    private TbArticleMapper tbArticleMapper;

    public int countArticle(TbArticleCondition condition) {
        return tbArticleMapper.countArticleByCondition(condition);
    }

    public List<TbArticle> qryArticles(TbArticleCondition condition) {
        return tbArticleMapper.selectArticleByCondition(condition);
    }

    public TbArticle qryArticleById(Integer atcId) {
        return tbArticleMapper.selectArticleByAtcId(atcId);
    }

    public int addArticle(TbArticle inParam) {
        return tbArticleMapper.insertArticle(inParam);
    }

    public int updArticleById(TbArticle inParam) {
        return tbArticleMapper.updateArticleByAtcId(inParam);
    }
}